<?php

namespace app\model;
use think\Model;

class User extends Model {
    //UserModel  如果类名不是表名的小写，是其它名字，要指定表名s
    //protected $name = 'user';
    //protected $table = 'think_user';
    //如果主键不为id，需要设定对应的主键
    //protected $pk = 'uid';
    //表带后缀
    //protected $suffix = '_cn';

    protected $autoWriteTimestamp = true;
    //定义时间戳字段名
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';

    public function getUser(){
        $user = $this->find(1);
        echo $user->getAttr('delete_time');
        echo '<br/>';
        echo $user->getAttr('name');
    }

}